import { getColor } from '@/utils'

/**
 * 悬浮框字段
 * @param type 点位类型
 * @param item 当前点位项
 * @private
 */
export const _setHoverData = (type, item) => {
  console.log('type', type)
  console.log('悬浮框', item)
  let content, contItem
  if (type === 'WATER' || item.lx === '河流' || type === 'dbshui' || type.trim() === 'dbsszzdz' || type === '' || type === '国控' || type.trim() === '国考' || type.trim() === '其他' || type.trim() === '省考') {
    if (item.mapPopType === 'dhcDbyys') { // 水质类别-饮用水
      contItem = [{
        label: '水源地名称', value: item.sydmc
      }, {
        label: '水质类别', value: item.szlbStr, hasColor: true, color: getColor(item.szlbStr, 'text')
      }, {
        label: '所属地市', value: item.prefecturename || item.sssmc || item.sscs
      }, {
        label: '水源地级别', value: item.sydjb || ''
      }, {
        label: '水源地类型', value: item.sydxz || ''
      }, {
        label: '数据时间', value: item.datatime || item.datatime
      }]
      content = { title: item.stationname || item.dmmc, factor: item.factorName, content: contItem }
    } else if (item.mapPopType === 'dhcHys') { // 地表水-地表水断面
      let szlbStr = item.szlbStr
      if (item.szlb === '/') {
        szlbStr += '(' + item.bz + ')'
      }
      contItem = [{
        label: '水质类别', value: szlbStr, hasColor: true, color: getColor(item.szlbStr, 'text')
      }, {
        label: '考核目标', value: item.khszmb + '类'
      }, {
        label: '所属地市', value: item.prefecturename || item.sssmc || item.sscs
      }, {
        label: '所属河流', value: item.rivername || item.sssx || item.hlmc || ''
      }, {
        label: '数据时间', value: item.datatime || item.datatime
      }]
      content = { title: item.stationname || item.dmmc, factor: item.factorName, content: contItem }
    } else {
      let riveName = item.rivername || item.sssx || item.hlmc || ''
      if (riveName.indexOf('|') !== -1) {
        riveName = riveName.split('|')[1]
      }
      contItem = [{
        label: '水质类别', value: item.szlbStr, hasColor: true, color: getColor(item.szlbStr, 'text')
      }, {
        label: '考核目标', value: item.szmb || '无', hasColor: true, color: getColor(item.szmb, 'text')
      }, {
        label: '所属地市', value: item.prefecturename || item.sssmc || item.sscs
      }, {
        label: '所属河流', value: riveName
      }, {
        label: '站点状态', value: item.stationstatus
      }, {
        label: '数据时间', value: item.datatime || item.datatime
      }]
      content = { title: item.stationname || item.dmmc, factor: item.factorName, content: contItem }
    }
  } else if (type === 'WRY') {
    contItem = [{
      label: '行政区划', value: item.xzqhmc
    }, /* {
        label: '企业状态',
        value: item.state
      },*/
    {
      label: '社会信用代码', value: item.psCode
    }]
    content = { title: item.psName, content: contItem }
  } else if (type === '污水管网') {
    contItem = [{
      label: '名称', value: item.NAME
    }, {
      label: '类型', value: '污水泵站'
    }]
    content = { title: item.NAME, content: contItem }
  } else if (type === 'WRYztqk') {
    if (item.hxxylpfl == '') {
      item.hxxylpfl = '-'
    }
    if (item.adpfl == '') {
      item.adpfl = '-'
    }
    if (item.zdpfl == '') {
      item.zdpfl = '-'
    }
    if (item.zlpfl == '') {
      item.zlpfl = '-'
    }
    contItem = [{
      label: '所属地市', value: item.city
    }, {
      label: '所属区县', value: item.county
    }, {
      label: '化学需氧量排放量', value: item.hxxylpfl + '吨'
    }, {
      label: '氨氮排放量', value: item.adpfl + '吨'
    }, {
      label: '总氮排放量', value: item.zdpfl + '吨'
    }, {
      label: '总磷排放量', value: item.zlpfl + '吨'
    }, {
      label: '受纳水体', value: item.snst
    }, {
      label: '运行状态', value: item.qyyxzt
    }]
    content = { title: item.unitname, content: contItem }
  } else if (type === 'WSC') { // 污水厂
    contItem = [{
      label: '行政区划', value: item.cityName + item.xzqhmc
    }, {
      label: '社会信用代码', value: item.psCode
    }]
    content = { title: item.psName, content: contItem }
  } else if (type === 'GIS') {
    if (item.mapPopType === 'gkzdz' || item.mapPopType === 'skzdz' || item.mapPopType === 'dbsdm') {
      contItem = [{
        label: '水质类别', value: item.szlbStr, hasColor: true, color: getColor(item.szlbStr, 'text')
      }, {
        label: '所属地市', value: item.prefecturename || item.sssmc || item.sscs
      }, {
        label: '所属河流', value: item.rivername || item.sssx || item.hlmc || ''
      }, {
        label: '数据时间', value: item.datatime || item.datatime
      }]
      content = { title: item.stationname || item.dmmc, factor: item.factorName, content: contItem }
    } else if (item.mapPopType === 'sswry') {
      contItem = [{
        label: '行政区划', value: item.xzqhmc
      }, {
        label: '企业状态', value: item.state
      }, {
        label: '社会信用代码', value: item.psCode
      }]
      content = { title: item.psName, content: contItem }
    }
  } else if (type === 'PWK') {
    var name = item.datatime
    if (name != undefined && name != '') {
      name = name.split('-')[0] + '年' + name.split('-')[1] + '月' + name.split('-')[2] + '日'
    } else {
      name = '-'
    }
    contItem = [{
      label: '监测单位', value: item.jcdw
    }, {
      label: '达标情况', value: item.dbqk
    }, {
      label: '监测时间', value: name
    }]
    content = { title: item.pwkmc, content: contItem }
  } else if (type === 'hlxx') {
    contItem = [{
      label: '河流名称', value: item.name
    }]
    content = { title: item.name, content: contItem }
  } else if (type === 'qyxx') {
    contItem = [{
      label: '区域内断面总量', value: item.nr1
    }, {
      label: '国考断面数', value: item.nr2
    }, {
      label: '省考断面数', value: item.nr3
    }, {
      label: '省级监控断面数', value: item.nr4
    }]
    content = { title: item.name, content: contItem }
  } else if (type === 'sxxx') {
    contItem = [{
      label: '水系内断面总数', value: item.nr1
    }, {
      label: '国考断面数', value: item.nr2
    }, {
      label: '省考断面数', value: item.nr3
    }, {
      label: '省级监控断面数', value: item.nr4
    }]
    content = { title: item.name, content: contItem }
  } else if (type === 'hcst') {
    if (item['地市'] == undefined) {
      item['地市'] = '-'
    }
    if (item['区县'] == undefined) {
      item['区县'] = '-'
    }
    if (item['水体类别'] == undefined) {
      item['水体类别'] = '-'
    }
    contItem = [{
      label: '所属地市', value: item['地市']
    }, {
      label: '所属区县', value: item['区县']
    }, {
      label: '水体类别', value: item['水体类别']
    }]
    content = { title: item['黑臭水体名称'], content: contItem }
  } else if (type === 'hjzl') {
    // 悬浮弹窗

    contItem = [{
      label: '所属城市', value: item.data.cityName
    }, {
      label: '监测时间', value: item.data.sjsj
    }, {
      label: '海水水质', value: item.data.szlb
    }]
    content = { title: item.data.dwdm, content: contItem }
  } else if (type === 'rhpwk') {
    // 悬浮弹窗
    contItem = [{
      label: '城市名称', value: item.cityName
    }, {
      label: '排口名称', value: item.outletName
    }, {
      label: '排口代码', value: item.outletCode
    }

    ]
    content = { title: item.psName, content: contItem }
  } else if (type === 'jahy_hsyc' || type === 'jahy_jahy' || type === 'jahy_ycwwhy' || type === 'jahy_zdhkhy' || type === 'jahy_qhdghy' || type === 'jahy_ychzbhxqxjc') {
    if (item.lx === 'jahy_jahy') {
      contItem = [{
        label: '点位名称', value: item.gkCode
      }, {
        label: '区域类型', value: item.dwlx
      }]
      content = { title: item.gkCode, content: contItem }
    } else if (item.lx === 'jahy_hsyc') {
    } else if (item.lx === 'jahy_ycwwhy') {
      contItem = [{
        label: '点位名称', value: item.dwmc
      }, {
        label: '区域类型', value: item.dwlx
      }, {
        label: '水质类别', value: item.waterQuality
      }, {
        label: '监测时间', value: item.jcrq
      }]
      content = { title: item.dwmc, content: contItem }
    } else if (item.lx === 'jahy_zdhkhy') {
      contItem = [{
        label: '点位名称', value: item.dwmc
      }, {
        label: '区域类型', value: item.dwlx
      }, {
        label: '水质类别', value: item.waterQuality
      }, {
        label: '监测时间', value: item.jcrq
      }]
      content = { title: item.dwmc, content: contItem }
    } else if (item.lx === 'jahy_qhdghy') {
      contItem = [{
        label: '点位名称', value: item.dwmc
      }, {
        label: '区域类型', value: item.dwlx
      }, {
        label: '水质类别', value: item.waterQuality
      }, {
        label: '监测时间', value: item.jcrq
      }]
      content = { title: item.dwmc, content: contItem }
    } else if (item.lx === 'jahy_ychzbhxqxjc') {
      contItem = [{
        label: '点位名称', value: item.dwmc
      }, {
        label: '区域类型', value: item.dwlx
      }]
      content = { title: item.dwmc, content: contItem }
    }
  } else if (type == '入河排污口') {
    contItem = [{
      label: '所属地市', value: item.ssds
    }, {
      label: '所属县区', value: item.ssqx
    }, {
      label: '排入河流名称', value: item.hlmc
    }, {
      label: '排口类型', value: item.pklx
    }, {
      label: '排污主体', value: item.pwzt
    }]
    content = { title: '入河排污口', content: contItem }
  } else if (type == '傍河村庄') {
    // console.log('傍河村庄数据',item)
    contItem = [{
      label: '村庄名称', value: item.czmc
    }, {
      label: '所属地市', value: item.ssds
    }, {
      label: '所属县区', value: item.ssqx
    }, {
      label: '所属乡镇', value: item.ssxz
    }, {
      label: '傍河河流名称', value: item.hlmc
    }]
    content = { title: '傍河村庄', content: contItem }
  } else if (type == '傍河规上畜禽养殖') {
    contItem = [{
      label: '养殖场名称', value: item.yzcmc
    }, {
      label: '所属地市', value: item.ssds
    }, {
      label: '所属县区', value: item.ssqx
    }, {
      label: '傍河河流名称', value: item.hlmc
    }, {
      label: '养殖种类', value: item.yzzl
    }]
    content = { title: '规上畜禽养殖', content: contItem }
  } else if (type == '傍河规下畜禽养殖') {
    contItem = [{
      label: '养殖户名称', value: item.yzcmc
    }, {
      label: '所属地市', value: item.ssds
    }, {
      label: '所属县区', value: item.ssqx
    }, {
      label: '傍河河流名称', value: item.hlmc
    }, {
      label: '养殖种类', value: item.yzzl
    }]
    content = { title: '规下畜禽养殖', content: contItem }
  } else if (type == '水产养殖企业') {
    contItem = [{
      label: '养殖场名称', value: item.mc
    }, {
      label: '所属地市', value: item.ssds
    }, {
      label: '所属县区', value: item.ssqx
    }, {
      label: '傍河河流名称', value: item.hlmc
    }, {
      label: '养殖类型', value: item.yzgmjlx
    }, {
      label: '水产养殖场类型', value: item.scyzlx
    }]
    content = { title: '1', content: contItem }
  } else if (type == '污水处理厂') {
    contItem = [{
      label: '企业名称', value: item.mc
    }, {
      label: '所属地市', value: item.ssds
    }, {
      label: '所属县区', value: item.ssqx
    }, {
      label: '排入河流名称', value: item.hlmc
    }, {
      label: '处理规模（吨/天）', value: item.clgm
    }]
    content = { title: '污水处理厂', content: contItem }
  } else if (type == '沿海涉氮企业') {
    contItem = [{
      label: '企业名称', value: item.mc
    }, {
      label: '所属地市', value: item.ssds
    }, {
      label: '所属县区', value: item.ssqx
    }, {
      label: '傍河（排污）河流名称', value: item.hlmc
    }, {
      label: '行业类型', value: item.hylx
    }]
    content = { title: '涉氮企业', content: contItem }
  } else if (type == '闸坝') {
    contItem = [{
      label: '闸坝名称', value: item.mc
    }, {
      label: '所属地市', value: item.ssds
    }, {
      label: '河流名称', value: item.hlmc
    }, {
      label: '控制单位', value: item.kzdw
    }]
    content = { title: '闸坝', content: contItem }
  } else if (type == '人工湿地') {
    contItem = [{
      label: '湿地名称', value: item.mc
    }, {
      label: '所属地市', value: item.ssds
    }, {
      label: '所属县区', value: item.ssqx
    }, {
      label: '傍河河流名称', value: item.hlmc
    }, {
      label: '湿地面积', value: item.mj
    }]
    content = { title: '人工湿地', content: contItem }
  } else if (type == '河湖缓冲带') {
    contItem = [{
      label: '缓冲带名称', value: item.mc
    }, {
      label: '所属地市', value: item.ssds
    }, {
      label: '所属县区', value: item.ssqx
    }, {
      label: '傍河河流名称', value: item.hlmc
    }, {
      label: '缓冲带面积', value: item.mj
    }]
    content = { title: '河湖缓冲带', content: contItem }
  } else if (type == '海洋倾倒区') {
    contItem = [{
      label: '类型', value: type
    }]
    content = { title: item.V, content: contItem }
  } else if (type == '海洋生态红线') {
    contItem = [{
      label: '类型', value: type
    }, {
      label: '行政隶属', value: item['行政隶']
    }, {
      label: '功能区', value: item['功能区']
    }]
    content = { title: item['保护区'], content: contItem }
  } else if (type == '石油勘探开发设施') {
    contItem = [{
      label: '类型', value: type
    }, {
      label: '备注', value: item.item['备注'] == undefined ? '-' : item.item['备注']
    }]
    content = { title: item.item['名称'], content: contItem }
  } else if (type == '自然保护地') {
    contItem = [{
      label: '类型', value: type
    }, {
      label: '级别', value: item['级别']
    }, {
      label: '市', value: item['市']
    }, {
      label: '县（区）', value: item['县（区']
    }, {
      label: '功能分', value: item['功能分']
    }]
    content = { title: item['保护区'], content: contItem }
  } else if (type == '湾区划分') {
    var shi = item['市']
    if (shi == undefined) {
      var zhis = item['名称']
      if (zhis.includes('唐山')) {
        shi = '唐山'
      }
      if (zhis.includes('秦皇岛')) {
        shi = '秦皇岛'
      }
    }
    contItem = [{
      label: '所属地区', value: shi
    }, {
      label: '面积', value: item['面积'] + '平方千米'
    }]
    content = { title: item['名称'], content: contItem }
  } else if (type == '美丽海湾建设时序') {
    contItem = [{
      label: '类型', value: type
    }, {
      label: '市', value: item['市']
    }, {
      label: '时序', value: item['时序']
    }, {
      label: '面积', value: item['面积']
    }]
    content = { title: item['名称'], content: contItem }
  } else if (type == 'rhdm') {
    let szlbStr = item.szlbStr
    if (item.szlb === '/') {
      szlbStr += '(' + item.bz + ')'
    }
    contItem = [{
      label: '水质类别', value: item.szlb, hasColor: true, color: getColor(item.szlb, 'text')
    }, {
      label: '考核目标', value: item.khszmb + '类'
    }, {
      label: '所属地市', value: item.prefecturename || item.sssmc || item.sscs
    }, {
      label: '所属河流', value: item.rivername || item.sssx || item.hlmc || ''
    }, {
      label: '数据时间', value: item.rq
    }]
    content = { title: item.dmmc, content: contItem }
  } else if (type == 'rhk') {
    contItem = [{
      label: '名称', value: item.mc
    }, {
      label: '类型', value: '入海口'

    }

    ]
    content = { title: item.mc, content: contItem }
  } else if (type === 'bdh_rhpwk') {
    console.log('item', item)
    contItem = [{
      label: '排污口命名', value: item.psName
    }, {
      label: '类型', value: '入海排污口'
    }, {
      label: '排污口编码', value: item.outletCode
    }, {
      label: '所属地区', value: item.cityName + ' - ' + item.countyName
    }]
    content = { title: item.psName, content: contItem }
  } else if (type === 'bdh_shfxy') {
    contItem = [{
      label: '单位名称', value: item.dwmc
    }, {
      label: '类型', value: '涉海风险源厂区范围'
    }, {
      label: '所属地区', value: item.ds
    }, {
      label: '详细地址', value: item.xxdz
    }]
    content = { title: item.dwmc, content: contItem }
  } else if (type == 'ycjcd') {
    contItem = [{
      label: '名称', value: item.mc
    }, {
      label: '类型', value: '重点海水浴场监测点位'

    }

    ]
    content = { title: item.mc, content: contItem }
  } else if (type == 'bzjcd') {
    contItem = [{
      label: '名称', value: item.mc
    }, {
      label: '类型', value: '保障监测点位'
    }

    ]
    content = { title: item.mc, content: contItem }
  } else if (type == 'gcn') {
    contItem = [{
      label: '名称', value: item.bh
    }, {
      label: '类型', value: '港池内监测点位'
    }

    ]
    content = { title: item.bh, content: contItem }
  } else if (type == 'gcw') {
    contItem = [{
      label: '名称', value: item.bh
    }, {
      label: '类型', value: '港池外监测点位'
    }

    ]
    content = { title: item.bh, content: contItem }
  } else if (type == 'wsclc') {
    contItem = [{
      label: '名称', value: item.wrymd

    }, {
      label: '类型', value: '污水处理厂'
    }]
    content = { title: item.wrymd, content: contItem }
  } else if (type == 'yhpk') {
    contItem = [{
      label: '名称', value: item.psly

    }, {
      label: '类型', value: '雨洪排口'
    }]
    content = { title: item.psly, content: contItem }
  } else if (type == 'zs') {
    contItem = [{
      label: '名称', value: item.mc

    }, {
      label: '类型', value: '声环境质量监测点位'
    }

    ]
    content = { title: item.mc, content: contItem }
  } else if (type == 'dq') {
    contItem = [{
      label: '名称', value: item.mc

    }, {
      label: '类型', value: ' 环境空气质量监测点位'
    }

    ]
    content = { title: item.mc, content: contItem }
  } else if (type == 'jahysjqx') {
    // 悬浮弹窗

    contItem = [{
      label: '所属城市', value: item.data.cityName
    }, {
      label: '测量时间', value: item.data.sjsj
    }, {
      label: '海水水质', value: item.data.szlb
    }]
    content = { title: item.data.dwdm, content: contItem }
  } else if (type == 'yysyd') {
    contItem = [// {
      //   label: '名称',
      //   value: item.mc
      // },

    ]
    content = { title: item.dwbm, content: contItem }
  } else if (type == 'zph') {
    contItem = [{
      label: '名称', value: item.dwbm
    }, {
      label: '类型', value: '直排海污染源监测点位'
    }

    ]
    content = { title: item.dwbm, content: contItem }
  } else if (type == 'b_gy') {
    contItem = [{
      label: '名称', value: item.unitname
    }, {
      label: '所属地市', value: item.city
    }, {
      label: '所属区县', value: item.county
    }, {
      label: '化学需氧量排放量', value: item.hxxylpfl === '' ? '' : item.hxxylpfl + '吨'
    }, {
      label: '氨氮排放量', value: item.adpfl === '' ? '' : item.adpfl + '吨'
    }, {
      label: '总氮排放量', value: item.zdpfl === '' ? '' : item.zdpfl + '吨'
    }, {
      label: '总磷排放量', value: item.zlpfl === '' ? '' : item.zlpfl + '吨'
    }, {
      label: '收纳水体', value: item.snst
    }, {
      label: '运行状态', value: item.qyyxzt
    }, {
      label: '类型', value: '工业企业'
    }]
    content = { title: item.unitname, content: contItem }
  } else if (type == 'b_jz') {
    contItem = [{
      label: '企业名称', value: item.unitname
    }, {
      label: '所属地市', value: item.city
    }, {
      label: '所属区县', value: item.county
    }, {
      label: '氨氮排放量', value: item.adpfl === '' ? '' : item.adpfl + '吨'
    }, {
      label: '总氮排放量', value: item.zdpfl === '' ? '' : item.zdpfl + '吨'
    }, {
      label: '总磷排放量', value: item.zlpfl === '' ? '' : item.zlpfl + '吨'
    }, {
      label: '收纳水体', value: item.snst
    }, {
      label: '运行状态', value: item.qyyxzt
    }]
    content = { title: item.unitname, content: contItem }
  } else if (type == 'b_1xq') {
    contItem = [{
      label: '名称', value: item.unitname
    }, {
      label: '所属地市', value: item.city
    }, {
      label: '所属区县', value: item.county
    }, {
      label: '化学需氧量排放量', value: item.hxxylpfl === '' ? '' : item.hxxylpfl + '吨'
    }, {
      label: '氨氮排放量', value: item.adpfl === '' ? '' : item.adpfl + '吨'
    }, {
      label: '总氮排放量', value: item.zdpfl === '' ? '' : item.zdpfl + '吨'
    }, {
      label: '总磷排放量', value: item.zlpfl === '' ? '' : item.zlpfl + '吨'
    }, {
      label: '收纳水体', value: item.snst
    }, {
      label: '运行状态', value: item.qyyxzt
    }, {
      label: '类型', value: '规上畜禽养殖'
    }]
    content = { title: item.unitname, content: contItem }
  } else if (type == 'b_2xq') {
    contItem = [{
      label: '名称', value: item.unitname
    }, {
      label: '类型', value: '规下畜禽养殖'
    }, {
      label: '所属地市', value: item.city ? item.city : '-'
    }, {
      label: '所属区县', value: item.county ? item.county : '-'
    }, {
      label: '受纳水体', value: item.hlmc ? item.hlmc : '-'
    }]
    content = { title: item.unitname, content: contItem }
  } else if (type == 'b_sc') {
    contItem = [{
      label: '名称', value: item.unitname
    }, {
      label: '所属地市', value: item.city
    }, {
      label: '所属区县', value: item.county
    }, {
      label: '化学需氧量排放量', value: item.hxxylpfl === '' ? '' : item.hxxylpfl + '吨'
    }, {
      label: '氨氮排放量', value: item.adpfl === '' ? '' : item.adpfl + '吨'
    }, {
      label: '总氮排放量', value: item.zdpfl === '' ? '' : item.zdpfl + '吨'
    }, {
      label: '总磷排放量', value: item.zlpfl === '' ? '' : item.zlpfl + '吨'
    }, {
      label: '收纳水体', value: item.snst
    }, {
      label: '运行状态', value: item.qyyxzt
    }, {
      label: '类型', value: '水产养殖'
    }]
    content = { title: item.unitname, content: contItem }
  } else if (type === 'b_pk') {
    contItem = [{
      label: '名称', value: item.pwkmc
    }, {
      label: '类型', value: '入河排污口'
    }, {
      label: '所属地市', value: item.city ? item.city : '-'
    }, {
      label: '所属区县', value: item.county ? item.county : '-'
    }, {
      label: '所属水系', value: item.sssx ? item.sssx : '-'
    }, {
      label: '经度', value: item.lon ? item.lon : '-'
    }, {
      label: '维度', value: item.lat ? item.lat : '-'
    }, {
      label: '排污口类型', value: item.pwkflyj + ' - ' + item.pwkflej + ' - ' + item.pwkflsj
    }]
    content = { title: item.pwkmc, content: contItem }
  } else if (type == 'b_cz') {
    contItem = [{
      label: '名称', value: item.unitname
    }, {
      label: '类型', value: '傍河村庄'
    }, {
      label: '所属地市', value: item.city ? item.city : '-'
    }, {
      label: '所属区县', value: item.county ? item.county : '-'
    }, {
      label: '受纳水体', value: item.hlmc ? item.hlmc : '-'
    }]
    content = { title: item.unitname, content: contItem }
  } else if (type == 'b_shfxy') {
    contItem = [{
      label: '名称', value: item.unitname
    }, {
      label: '类型', value: '涉海风险源厂区范围'
    }, {
      label: '所属地区', value: item.ds + ' - ' + item.qx
    }, {
      label: '详细地址', value: item.xxdz ? item.xxdz : ''
    }]
    content = { title: item.unitname, content: contItem }
  } else if (type == 'b_wsbz') {
    contItem = [{
      label: '名称', value: item.unitname
    }, {
      label: '类型', value: '污水泵站'
    }]
    content = { title: item.unitname, content: contItem }
  }
  // 总氮悬浮框
  else if (type == 'zd') {
    contItem = [{
      label: '断面名称', value: item.dmmc
    }, {
      label: '经度', value: item.jd
    }, {
      label: '纬度', value: item.wd
    }, {
      label: '浓度', value: item.nd
    }, {
      label: '对比值', value: item.bz
    }]
    content = { title: '河湖缓冲带', content: contItem }
  } else if (type == '锚地面') {
    contItem = [{
      label: '水域面积', value: item['面积'] + '平方公里'
    }, {
      label: '用途', value: item['用途']
    }]
    content = { title: item['锚地'], content: contItem }
  } else if (type == '锚地点') {
    contItem = [{
      label: '所属锚地', value: item['锚地']
    }, {
      label: '位置', value: item['lon'] + ',' + item['lat']
    }]
    content = { title: item['控制点'], content: contItem }
  } else if (type == '溢油点') {
    contItem = [{
      label: '时间', value: item['time']
    }, {
      label: '污染物种类', value: item['type']
    }, {
      label: '油污直径', value: item['ywzj']
    }]
    content = { title: item['name'], content: contItem }
  } else if (type == '秦皇岛市生态保护红线') {
    contItem = [{
      label: '类型', value: '涉海风险源厂区范围'
    }, {
      label: '所属地区', value: item['SHI'] + item['XIAN']
    }, {
      label: 'HXLX', value: item['HXLX']
    }, {
      label: '管控措施', value: item['GKCS']
    }]
    content = { title: item['NAME'], content: contItem }
  } else if (type == '污水管道') {
    contItem = [{
      label: '类型', value: type
    }]
    content = { title: item['Layer'], content: contItem }
  } else if (type == '污水流向') {
    contItem = [{
      label: '类型', value: type
    }]
    content = { title: item['Layer'], content: contItem }
  } else if (type == '管网问题') {
    contItem = [{
      label: '位置', value: item['wz']
    }, {
      label: '类型', value: '管网问题点位'
    }, {
      label: '所属地区', value: item['ds'] + item['qx']
    }, {
      label: '时间', value: item['nian'] + '-' + item['zhi1'] + '-' + item['zhi2']
    }]
    content = { title: '管网破损点位', content: contItem }
  } else if (type == '涉海风险源厂区排口') {
    var mz = ''
    if (item['受纳水'] != undefined) {
      mz = item['受纳水']
    }
    contItem = [{
      label: '类型', value: type
    }, {
      label: '排口类型', value: item['排口类']
    }, {
      label: '排放去向', value: item['T2_排放']
    }, {
      label: '收纳水体', value: mz
    }]
    content = { title: item['NAME'], content: contItem }
  } else if (type == '水母') {
    contItem = [{
      label: '类型', value: '拦截导流网'
    }]
    content = { title: item['名称'], content: contItem }
  } else if (type == '水母点') {
    contItem = [{
      label: '类型', value: '水母打捞作业区'
    }]
    content = { title: item['lb'], content: contItem }
  } else if (type == '赤潮') {
    var yuefen = item['item']['User_date']
    yuefen = yuefen.substring(yuefen.length - 4)
    yuefen = Number(yuefen.substring(0, 2))
    var cishu = 0
    cishu = item['item']['the_geom']['$f'].length
    contItem = [{
      label: '赤潮发生次数', value: cishu + '次'
    }, {
      label: '赤潮发生月份', value: yuefen + '月'
    }]
    var name = item['item']['类别2']
    if (name == undefined) {
      name = '赤潮'
    }
    content = { title: '赤潮过程次数', content: contItem }
  } else if (type == '沉潜连线') {
    contItem = [{
      label: '沉潜油控网长度', value: '1.503千米'
    }]
    content = { title: item['备注'] == 'AB' ? '葡萄岛和洋河口之间' : '浅水湾', content: contItem }
  } else if (type == '沉潜点') {
    var wz = ''
    if (item['备注'] == 'A') {
      wz = '葡萄岛和洋河口之间'
    } else if (item['备注'] == 'B') {
      wz = '葡萄岛和洋河口之间'
    } else if (item['备注'] == 'C') {
      wz = '浅水湾'
    } else if (item['备注'] == 'D') {
      wz = '浅水湾'
    }
    contItem = [{
      label: '沉潜油控网长度', value: '1.503千米'
    }]
    content = { title: wz, content: contItem }
  } else if (type == '涉海风险源厂区范围') {
    contItem = [{
      label: '类型', value: type
    }, {
      label: '面积', value: item['SmArea']
    }, {
      label: '长度', value: item['SmPerimeter']
    }]
    content = { title: item['NAME'], content: contItem }
  } else if (type == '收水范围') {
    contItem = [{
      label: '类型', value: type
    }]
    // content = { title: item['名称'], content: contItem }
    content = { title: (item['anotherName'] || item['名称']), content: contItem }
  } else if (type == '藻类') {
    contItem = [{
      label: '类型', value: '大型藻类多发区域（集中打捞作业区）'
    }]
    content = { title: '大型藻类多发区域', content: contItem }
  }
  return content
}

/**
 * 悬浮框布局
 * @param data
 * @param types
 * @private
 */
export const _setHoverContent = (data, types) => {
  if (data == undefined || types == data) {
    return ''
  }
  var sf = false
  var minkuan = '106'
  if (types != undefined) {
    if (types == 'xx') {
      sf = true
      minkuan = '50'
    }
    if (types == 'xxs') {
      sf = true
      minkuan = '50'
    }
  }
  var content = ''
  if (sf) {
    content = `<slot name="content">
      <ul>
          ${data.content.map((item) => {
    return `<li><label style="min-width:${minkuan}px;">${item.label}：</label>${item.hasColor ? `<p class="${item.color}">${item.value}</p>` : `<p>${item.value}</p>`}</li>`
  }).join('')}
          ${data.content.map((item) => {
    // return `<li><label style="min-width:${minkuan}px;">一河一策一图：</label>
    //       <el-button type="primary" size="mini" class="hl_an" onClick="hl_xiazai()">下载</el-button>
    //       <el-button type="primary" size="mini" class="hl_an" onClick="hl_yulan()">预览</el-button></li>`
  }).join('')}<li>
      </ul>
    </slot>`
  } else {
    content = `<div>
      <div class="mapHoverTitle">${data.title}${data.factor ? `<span class="font-size-sm">${data.factor}</span>` : ``}</div>
      <div class="mapHoverContent">
        <slot name="content">
          <ul>
              ${data.content.map((item) => {
    return `<li><label style="min-width:92px;">${item.label}：</label>${item.hasColor ? `<p class="${item.color}">${item.value}</p>` : `<p>${item.value}</p>`}</li>`
  }).join('')}
          </ul>
        </slot>
      </div>
    </div>`
  }
  if (types != undefined) {
    if (types == 'xx' || types == 'xxs') {
      return '<div class="contens_gao">' + content + '</div>'
    }
  }
  return '<div class="ol_qipao">' + content + '</div>'
}
